<template>
    <div>
      <van-nav-bar title="修改" left-arrow @click-left="onClickLeft" @click-right="onClickRight" right-text="保存"/>
  
      <div>
<van-cell-group>
  <van-field v-model="username" placeholder="请输入用户名" />
</van-cell-group>
      </div>
    </div>
  </template>
  
  <script>
      import { getUserInfo , updataInfo} from "../request/http";
  export default {
    data() {
      return {
          username:this.$route.query.data
      };
    },
    methods: {
      onClickLeft() {
        this.$router.go(-1);
      },
      change(i){
          this.flag = i
      },
      onClickRight() {
        this.upInfo({
          nickname:this.username
        })
      },
      upInfo(data){
        updataInfo(data).then(res=>{
          console.log(res);
          this.$router.push('/info')
        })
      },
    },
    computed: {
      name() {
        return this.$route.query.data;
      },
    },
  };
  </script>
  
  <style lang="scss" scoped>

  </style>